#include <iostream>
#include <vector>

using namespace std;


vector<vector<int>> ans;
vector<int> path;


void backtracking(int n, int k, int start_index)
{
    if (path.size() == k)
    {
        ans.push_back(path);
        return;
    }

    for (int i = start_index; i <= n; i++)
    {
        path.push_back(i);
        backtracking(n, k, i + 1);
        path.pop_back();
    }
}



int main()
{
    int n = 4, k = 2;

    backtracking(n, k, 1);

    return 0;
}